const mongoose = require("mongoose");
const dbURL = "mongodb://localhost:27017/rentalCar"//rentCar是项目名称
mongoose.connect(dbURL, { useNewUrlParser: true, useUnifiedTopology: true });
//当数据库连接成功后，触发
mongoose.connection.once('open', () => {
  console.log(dbURL + '  数据库启动成功');
})